#ifndef PeaksAndValleys_h__
#define PeaksAndValleys_h__

#include "Scene/Scene.h"
#include "Scene/SceneEntity.h"
#include "GameWorld/GameWorld.h"
#include "Common/CommonTypes.h"

class CMeshRenderObject;

class CPeakValleySceneEntity : public CSceneEntity
{
public:
	CPeakValleySceneEntity(EntityID entityID, const std::string& entityName, ESceneEntityType entityType);
	~CPeakValleySceneEntity();

	virtual bool Init();
	virtual bool Load( const std::string& filepath );
	virtual void Update( float fTime );
	virtual void Render();

	void         CreateGeometry(UINT32 dwRowNum, UINT32 dwColNum, float dx);

private:
	float       _GetHeight(float fX, float fZ);

private:
	UINT32 m_dwRowNum;
	UINT32 m_dwColNum;

	UINT32 m_dwVertexNum;
	UINT32 m_dwFaceNum;

	CMeshRenderObject *m_pRenderObj;
};

class CPeaksAndValleysModule : public GameModule
{
public:
	CPeaksAndValleysModule();
	virtual ~CPeaksAndValleysModule();

	virtual void Init();
	virtual void UnInit();
	virtual void Update(float fTime);

private:
	SceneID   m_SceneID;
	EntityID  m_EntityID;

};
#endif // PeaksAndValleys_h__
